/*
 * Copyright (C) 2011 Nanohex Corp.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.nanohexcorp.kudocode.snapqr.db;

public class QRLinksHelper {
  protected static final String DATABASE_TABLE = "qrlinks";

  protected static final int INDEX_ROWID = 0;
  protected static final int INDEX_TITLE = 1;
  protected static final int INDEX_URL   = 2;
  protected static final int INDEX_DESCRIPTION = 3;

  protected static final String KEY_ROWID = "id";
  protected static final String KEY_TITLE = "title";
  protected static final String KEY_URL   = "url";
  protected static final String KEY_DESCRIPTION = "description";

  protected static final String CREATE_TABLE = "CREATE TABLE IF NOT EXISTS " + DATABASE_TABLE + "(" + KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + KEY_TITLE + " TEXT NOT NULL, " + KEY_URL + " TEXT NOT NULL, " + KEY_DESCRIPTION + " TEXT NOT NULL);";
  protected static final String DROP_TABLE = "DROP TABLE IF EXISTS " + DATABASE_TABLE;

  protected static final String INSERT = "INSERT INTO "+ DATABASE_TABLE + "(title, url, description) values (?,?,?);";
  protected static final String UPDATE = "UPDATE "+ DATABASE_TABLE + " SET title=?, url=?, description=? WHERE (id=?);";
  protected static final String SELECT = "SEELCT "+ INDEX_ROWID + ", " + INDEX_TITLE + ", " + INDEX_URL + ", " + INDEX_DESCRIPTION + "";
}
